package com.seal.tsms.system.entity;

import com.seal.tsms.base.entity.BaseEntity;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by seal.jing on 2016/1/2.
 */
@Entity
@Table(name = "SYS_PERMISSION")
public class SystemPermission extends BaseEntity {
    private String name;
    private String description;
    private int statu;
    private Set<RolePermission> rolesPermission=new HashSet<RolePermission>();

    @OneToMany(cascade = CascadeType.ALL,mappedBy = "permission")
    public Set<RolePermission> getRolesPermission() {
        return rolesPermission;
    }

    public void setRolesPermission(Set<RolePermission> rolesPermission) {
        this.rolesPermission = rolesPermission;
    }

    @Column(name = "PERMISSION_NAME")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "PERMISSION_DESCRIPTION")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Column(name = "PERMISSION_STATU")
    public int getStatu() {
        return statu;
    }

    public void setStatu(int statu) {
        this.statu = statu;
    }
}
